home *** CD-ROM | disk | FTP | other *** search
- UNIT model_h;
-
- { ------------------------------------------------------------------
-
- This program and its associates implement in Turbo Pascal v5
- the aritmetic encoding/decoding algorithms presented in the papers
-
- "Arithmetic Coding for Data Compression"
-
- by Ian H. Witten
- Radford M. Neal
- John G. Cleary
-
- pp 520 - 540 of June 1987 Communications of the ACM
-
- and
-
- "An Adaptive Dependency Source Model For Data Compression"
-
- by David M. Abrahamson
-
- pp 77 - 83 of January 1989 Communications of the ACM
-
- ------------------------------------------------------------------
-
- Implemented by Ken Westerback : CompuServe 73547,3520
-
- version 1.0 released 89/02/19
- version 2.0 released 89/02/27
-
- These programs, units and associated documentation are released
- into the public domain to be used and abused as your whims
- dictate.
-
- Feel free to distribute/incorporate/improve as desired.
-
- >>>>> Use at your own risk! <<<<<
-
- Comments and suggestions welcome via CompuServe.
-
- ------------------------------------------------------------------
- }
-
- INTERFACE
-
- { characters are in the range of 0..255 ( one byte ) while symbols are in }
- { the range 1..257, with a symbol of 0 being a dummy value used to store }
- { sentinal values in some arrays }
-
- const no_of_chars = 256; { number of different characters }
- eof_symbol = no_of_chars + 1; { EOF symbol }
- no_of_symbols = no_of_chars + 1; { total number of symbols }
- max_frequency = 16383; { maximum allowed frequency count }
- { = 2**14 -1 }
-
- fix_model_id = 'f';
- adaptive_model_id = 'a';
- adaptive_dependency_model_id = 'd';
-
- valid_models = [ 'f', 'a', 'd' ];
-
- { cumulative & non-cumulative symbol frequencies }
-
- var cum_freq : array [ 0..no_of_symbols ] of word;
- freq : array [ 0..no_of_symbols ] of word;
-
- IMPLEMENTATION
-
- END. { model 'header' }